﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GpuProgramCompiler
{
	internal class CompiledShader
	{
		public class Constant
		{
			private String name;
			private String type;
			private int offset;
			private int size;
			
			public String Name
			{
				get { return name; }
				set { name = value; }
			}
			
			public String Type
			{
				get { return type; }
				set { type = value; }
			}

			public int Offset
			{
				get { return offset; }
				set { offset = value; }
			}

			public int Size
			{
				get { return size; }
				set { size = value; }
			}
		}

		public class ConstantTable
		{
			private String name;
			private List<Constant> constants = new List<Constant>();

			public String Name
			{
				get { return name; }
				set { name = value; }
			}

			public List<Constant> Constants
			{
				get { return constants; }
			}
		}

		public class Program
		{
			private String name;
			private String type;
			private Byte[] code;

			public Program(String inName, String inType, Byte[] inCode)
			{
				Name = inName;
				Type = inType;
				Code = inCode;
			}

			public String Name
			{
				get { return name; }
				set { name = value; }
			}

			public Byte[] Code
			{
				get { return code; }
				set { code = value; }
			}

			public String Type
			{
				get { return type; }
				set { type = value; }
			}
		}

		private List<Program> programs = new List<Program>();
		private List<ConstantTable> constantTables = new List<ConstantTable>();

		public List<Program> Programs 
		{
			get { return programs; }
		}

		public List<ConstantTable> ConstantTables
		{
			get { return constantTables; }
		}
	}
}
